package com.dongzw.spring.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

//@Aspect
//@Component
public class DogAspect {

	@Around("execution(public void com.dongzw.spring.component.Dog.*())")
	public Object dogAspect(ProceedingJoinPoint point) {
		System.out.println("dog aspect before");
		Object proceed = null;
		try {
			proceed = point.proceed();
		} catch (Throwable throwable) {
			throwable.printStackTrace();
		}
		System.out.println("dog aspect after");
		return proceed;
	}

}
